<template>
  <div>
    <p>{{ count }}</p>
    <button @click="count++">累加</button>
    <button @click="destroy">卸载</button>
    <Header :car="car" :changCar="changCar"/>
    <List :car="car"/>
  </div>
</template>

<script>
import Header from "@/components/Header";
import List from "@/components/List";
export default {
  name: "App",
  data() {
    return {
      count: 1,
      car: "奥迪",
    };
  },
  methods: {
    destroy() {
      this.$destroy();
    },
    changCar() {
      this.car = "宝马";
    },
  },
  components: {
    Header,
    List,
  },
};
</script>

<style>
</style>